package com.project_doctor.controller;

import cn.hutool.crypto.digest.BCrypt;
import com.project_doctor.common.RedisConst;
import com.project_doctor.common.UserStatus;
import com.project_doctor.exception.Assert;
import com.project_doctor.exception.BusinessCode;
import com.project_doctor.exception.SystemCode;
import com.project_doctor.pojo.Dto.PersonalProfileDto;
import com.project_doctor.pojo.Dto.RegisterRequest;
import com.project_doctor.pojo.PersonalProfile;
import com.project_doctor.pojo.Role;
import com.project_doctor.pojo.Vo.PersonalProfileVo;
import com.project_doctor.service.PersonalProfileService;
import com.project_doctor.service.RoleService;
import com.project_doctor.util.JwtUtil;
import com.project_doctor.util.SmsUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.time.Duration;
import java.util.*;
import java.util.List;

@CrossOrigin
@Slf4j
@RestController
@RequestMapping("role")
public class RoleController {
    @Autowired
    private JwtUtil jwtUtil;

    @Autowired
    private RedisTemplate redisTemplate;

    @Autowired
    RoleService roleService;
    //注入Rabbit模板类
    @Autowired
    private RabbitTemplate rabbitTemplate;


    @GetMapping("/getRoleOptions")
    public ResponseEntity<?> getRoleOptions() {
        List<Role> list = roleService.list();
        return ResponseEntity.ok(list);
    }


}
